package Router

import (
	"gin/study_1/utils"
	"github.com/gin-gonic/gin"
	"gin/study_1/Router/LogSeting"
	"gin/study_1/Router/MiddlewaresSeting"
	"gin/study_1/Router/RouterGroupSeting"


)

var router *gin.Engine

func InitRouter() {
	router = gin.Default()
	// 设置日志
	LogSeting.SetLog(router)
	// 中间件相关的设置
	MiddlewaresSeting.SetMiddlewares(router)
	// 路由相关的设置
	RouterGroupSeting.SetRouteGroup(router)
	// 运行端口
	router.Run(":" + utils.TheGlobalconfig.Self.Port)
}
